<template>
	<view>
		<NavbarSetting />
		<view class="load-main">
			<view class="load-box">
				<view class="part">
					<view class="text">邮箱：</view>
					<view class="info">{{email}}</view>
				</view>
				<view class="part">
					<view class="text">昵称：</view>
					<input class="input" type="text" v-model="username" />
				</view>
			</view>
		</view>
		<view class="submit">
			<button class="btn-submit" @tap="submit()">保存修改</button>
		</view>
	</view>
</template>

<script>
	import NavbarSetting from "../../uni_modules/navbar/navbar_setting.vue"

	import httpTypes from '@/js/http-types.js'

	export default {
		data() {
			return {
				email: '',
				username: '',
			}
		},
		onLoad() {

		},
		mounted() {
			httpTypes.request({
				url: 'admin/user/getUser',
				method: 'GET',
				success: (res) => {
					this.email = res.data.data.User.email;
					this.username = res.data.data.User.username;
				}
			});
		},
		methods: {
			submit() {
				httpTypes.request({
					url: '',
					method: 'GET',
					data:{
						email: this.email,
						username: this.username
					},
					success: (res) => {
						
					}
				});
			}
		},
		components: {
			NavbarSetting,
		}
	}
</script>

<style lang="scss">
	.load-main {
		display: flex;
		justify-content: center;
		width: 100%;
	}

	.load-box {
		width: 90%;
		height: 140px;
	}
	
	.part{
		display: flex;
		justify-content: center;
		width: 100%;
		height: 50px;
		border-bottom: #C0C0C0 1px solid;
	}
	
	.text{
		font-size: larger;
		width: 20%;
		display: flex;
		flex-direction: column;
		justify-content: center;  //垂直居中
	}
	
	.info{
		font-size: large;
		width: 80%;
		display: flex;
		flex-direction: column;
		justify-content: center;  //垂直居中
	}
	
	.input{
		font-size: large;
		width: 80%;
		height: 50px;
		display: flex;
		flex-direction: column;
		justify-content: center;  //垂直居中
	}
	
	.btn-submit{
		width: 40%;
		background-color: #F0F0F0;
	}
</style>
